#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<sstream>
using namespace std;

class Solution{
    public:
    //my ans
    int ans1(string s){
        vector<string> words;
        string spilt = " ", temp;
        stringstream ss;
        ss << s;
        while(ss >> temp){
            words.push_back(temp);
        }
        int length = words.size();

        return words[length-1].size();
    }
};

void test1(){
    Solution s;
    string str = "Hello World";
    int ret = s.ans1(str);
    cout << ret << endl;
}

void test2(){
    Solution s;
    string str = "   fly me   to   the moon  ";
    int ret = s.ans1(str);
    cout << ret << endl;
}

void test3(){
    Solution s;
    string str = "luffy is still joyboy";
    int ret = s.ans1(str);
    cout << ret << endl;
}

int main(void){
    test1();
    test2();
    test3();

    return 0;
}